package com.example.ljdemo.infrastructure.responce;

import lombok.Getter;

/**
 * msg为国际化配置，这样给前端的提示会根据设置的Locale自适应
 *
 * @author jingjing.dong
 * @since 2021/3/21-18:20
 */
@Getter
public enum ErrorCode {
    BAD_REQUEST(10000),
    IDEMPOTENT_VALIDATE_FAIL(10001),
    AUTH_ACCESS_DENIED(10002),
    AUTH_UNAUTHENTICATED(10003),
    AUTH_AUTHENTICATED_FAILURE(10004),
    AUTH_AUTHENTICATED_SUCCESS(10005),
    AUTH_LOGOUT(10006),
    AUTH_VERIFY_CODE_ERROR(10007),
    LOCK_ALREADY_OCCUPIED(10008),


    INTERNAL_SERVER_ERROR(20000),
    ENCRYPT_ERROR(200001),
    CHECK_MESSAGE_WHITELIST_FAIL(20002),
    PROCESS_TEMPLATE_ERROR(20003),

    REMOTE_ERROR(30000),
    REDIS_OPS_RESULT_IS_NULL(30001),
    MAIL_SEND_ERROR(30002),
    UPLOAD_FILE_NOT_VALIDATE(30003),
    FETCH_FROM_DATALAKE_FAILED(30004),

    SYS_ERROR(40000),
    MAIL_NO_RECIPIENT(40001),
    MAIL_ADDRESS_FORMAT_ERROR(40002);

    private final int code;

    ErrorCode(int code) {
        this.code = code;
    }
}
